#pragma once

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <GLFW/glfw3.h>

class Camera {
public:
    Camera(glm::vec3 position, float pitch, float yaw, glm::vec3 worldUp, float sensitiveMove, float sensitiveSpeed,
           float fov);

    glm::vec3 Position;
    glm::vec3 Forward;
    glm::vec3 Right;
    glm::vec3 WorldUp;
    glm::vec3 Up;
    float Pitch, Yaw;//俯仰角(Pitch)、偏航角(Yaw)
    float FOV;//视野范围
    float SensitiveMove, SensitiveSpeed;
    float SpeedZ, SpeedX, SpeedY;

    //移动
    void Movement(float x, float y);

    //fov缩放
    void Scroll(float x, float y);

    void UpdateCameraPosition();

    glm::mat4 GetViewMatrix();


private:
    void UpdateCameraVector();

    bool isFirst = true;
    float lastX, lastY;
};
